<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>后台管理系统</title>
<%@include file="/WEB-INF/base.jspf"%>
<link rel="stylesheet" type="text/css" href='/css/font_628862_luv29kvrtore8kt9.css' />
<style>
	.modal-dialog {
		max-width: 1000px;
	}
	.layui-body {
		display:flex;
	}
    .icon {
       width: 1em; height: 1em;
       vertical-align: -0.15em;
       fill: currentColor;
       overflow: hidden;
    }	
    .span-c-nolotterNotice {
    	display:none;
    	color:red;
    	font-weight:bold;
    	cursor: pointer;
    }
    .span-c-nolotterNotice.active {
    	display:inline-block;
    }
    .hidden-td {
    	display: none;
    }
	.input-c-lotterNumber {
		width:500px;
		height:50px;
		margin-right:12px;
		margin-bottom:12px;
		font-size:22px;
		font-weight:bold;
		margin-top:20px;
		
	}
	
	.comment{
		display:flex;
		cursor: pointer;
		position: absolute;
		right:200px;
		line-height: 60px;
	} 
	.comment div{
		margin-right: 20px;
	}
	.comment  span{
		color: #fff;
   		font-size: 16px;
	}  
	.comment span.number{
		margin-left:5px;
		border: 1px solid  #ddd;
		padding: 0px 8px;
		background: #ddd;
		border-radius: 50%;
		color: #000;
	}
	
	#table-i-dailiList th{
		text-align: center;
	}
	#table-i-dailiList td{
		text-align: center;
	}
	 
	#QzxxLevelModal{
	    position: absolute;
	      left:20%;
	     top:10%; 
	}
	.vip{
		color: red;
	}	
</style>
</head>
<body class="layui-layout-body">
<audio id="audio-i-undealNotice" src=""></audio>
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div style="display:flex;flex-direction:column;position: absolute;top:50%;transform:translateX(-50%) translateY(-50%);left:50%;color:rgba(255,255,255,.7);align-items:center;margin-left:45px;">
				<span class="">welcome to 后台管理系统 </span>
			 	<span class="span-c-nolotterNotice">有未获取开奖号码的彩种，请点击处理！</span>
			</div>
			<div class="comment">
				<div class="onlineUser">
					<span>onlineUser</span>
					<span class="number" id="onlineUser">0</span>
				</div>
				
				<div class="chongzhi">
						<span>充值</span>
						<span class="number" id="chongzhi">0</span>
				</div>
				
				<div class="tixian">
						<span>提款</span>
						<span class="number" id="tixain">0</span>
				</div>
			</div>
			
			<ul class="layui-nav layui-layout-right" style="position: relative;">
				<li id="i-id-autioSwitch" class="iconfont icon-audiohigh " style="font-size:22px;position: absolute;transform:translateY(-50%);top:50%;left:-10px;color:rgba(255,255,255,.7);cursor: pointer;"></li>
				<li class="layui-nav-item"><a href="">${manager.name} </a></li>
				<li class="layui-nav-item"><a href="/kajhsgweasdqtwehghasfdnsak6868/userLogout.do">退出</a></li>
			</ul>
		</div>
		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<ul class="layui-nav layui-nav-tree">
					<li class="layui-nav-item layui-nav-itemed" data-quanxian="1"><a class="" href="javascript:;">财务管理</a>
						<dl class="layui-nav-child">
							 <dd class="active class-li-customerButtons"  data-quanxian="2" data-myid="2">
								<a  href="/zhgl/userRechargePage.do" id="btn-i-deal-chongzhi"  class='yhcz' target="aa">用户充值管理</a>
							</dd>
							<dd class="active class-li-customerButtons"  data-quanxian="3" data-myid="2">
								<a  href="/zhgl/userDrawingPage.do" id="btn-i-deal-tikuan" target="aa">用户提款管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="4" data-myid="2">
								<a  href="/zhgl/userBalancePage.do" target="aa">用户金额管理</a>
							</dd>
							<dd class="active class-li-customerButtons"  data-quanxian="5" data-myid="2">
								<a  href="/zhgl/userWaterPage.do" target="aa">用户账变管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="6" data-myid="2">
								<a  href="/zhgl/userCodePage.do" target="aa">用户打码管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="7" data-myid="2">
								<a  href="/zhgl/userCodeRecordPage.do" target="aa">用户打码记录</a>
							</dd> 
							<dd class="active class-li-customerButtons" data-quanxian="8" data-myid="2">
								<a  href="/zhgl/backWaterSetupPage.do" target="aa">日常返水管理</a>
							</dd> 	
						</dl>
					</li>
					<li class="layui-nav-item"  data-quanxian="9"><a href="javascript:;">彩票管理</a>
						<dl class="layui-nav-child">
							<dd class="active class-li-customerButtons"  data-quanxian="10" data-myid="2">
								<a  href="/czgl/lotteryBettingPage.do" target="aa">彩票投注管理</a>
							</dd> 
							<dd class="active class-li-customerButtons" data-quanxian="11" data-myid="2">
								<a  href="/czgl/lotteryCheckPage.do" target="aa">彩票开奖管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-myid="2"  data-quanxian="12">
								<a href="/czgl/systemLotteryPresetRecordPage.do" target="aa">私彩预设管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="13" data-myid="2">
								<a  href="/czgl/hongKongLotteryPage.do" target="aa">港彩预设管理</a>
							</dd>																									
							<dd class="active class-li-customerButtons" data-quanxian="14" data-myid="2">
								<a  href="/czgl/hongKongLotteryAttrPage.do" target="aa">港彩属性管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="15" data-myid="2">
								<a  href="/czgl/specialCodeRebatePage.do" target="aa">特码返水管理</a>
							</dd>
							<dd class="active class-li-customerButtons"  data-quanxian="16" data-myid="2">
								<a  href="/czgl/lotteryPage.do" target="aa">彩票开启管理</a>
							</dd> 
							<dd class="active class-li-customerButtons" data-quanxian="17" data-myid="2">
								<a  href="/czgl/lotteryRatioPage.do" target="aa">彩票赔率管理</a>
							</dd>			
							<dd class="active class-li-customerButtons" data-quanxian="18" data-myid="2">
								<a  href="/czgl/lotteryAttributePage.do" target="aa">彩票球数管理</a>
							</dd>	
							<dd class="active class-li-customerButtons" data-quanxian="19" data-myid="2">
								<a  href="/bjlhtgl/baccaratPage.do" target="aa">百家乐管理</a>
							</dd>
						</dl>
					</li>
					<li class="layui-nav-item" data-quanxian="20"><a href="javascript:;">用户管理</a>
						<dl class="layui-nav-child">
							<dd class="active class-li-customerButtons" data-quanxian="21" data-my  id="2">
								<a href="/kajhsgweasdqtwehghasfdnsak6868/userPage.do" target="aa">平台用户管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="22" data-myid="2">
								<a href="/agents/agentPage.do" target="aa">平台代理管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="23" data-myid="2">
								<a  href="/agents/agentRecordPage.do" target="aa">代理返点记录</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="24" data-myid="2">
								<a  href="/agents/setupAgentPage.do" target="aa">代理返点管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="25" data-myid="2">
								<a href="/agents/dailiRulePage.do" target="aa">代理说明管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="26" data-myid="2">
								<a  href="/kajhsgweasdqtwehghasfdnsak6868/userChatRecord.do" target="aa">用户聊天管理</a>
							</dd>	
							<dd class="active class-li-customerButtons" data-quanxian="27" data-myid="2">
								<a  href="/kajhsgweasdqtwehghasfdnsak6868/userChatPage.do" target="aa">聊天屏蔽管理</a>
							</dd>	
							<dd class="active class-li-customerButtons" data-quanxian="28" data-myid="2">
								<a  href="/kajhsgweasdqtwehghasfdnsak6868/systemRedPackage.do" target="aa">系统红包管理</a>
							</dd>
						</dl>
						</li>
						
					<li class="layui-nav-item" data-quanxian="29"><a href="javascript:;">报表管理</a>
						<dl class="layui-nav-child">
							<dd class="active class-li-customerButtons" data-quanxian="30" data-myid="2">
								<a  href="/bbgl/globalReportPage.do" target="aa">全局报表管理</a>
							</dd> 
							<dd data-quanxian="31">
								<a href="/bbgl/financeReportPage.do" target="aa">财务报表管理</a>
							</dd>
							<dd data-quanxian="32">
								<a href="/bbgl/findStatisticsReport.do" target="aa">统计概况管理</a>
							</dd>
							<dd data-quanxian="33">
								<a href="/bbgl/operateReportPage.do" target="aa">运营报表管理</a>
							</dd>
							<dd data-quanxian="34">
								<a href="/bbgl/riskAssessmentPage.do" target="aa">风险评估管理</a>
							</dd>
							<dd data-quanxian="35">
								<a href="/bbgl/userDataPage.do" target="aa">用户概况管理</a>
							</dd>
						</dl>
						</li>
						<li class="layui-nav-item" data-quanxian="36"><a href="javascript:;">公告管理</a>
						<dl class="layui-nav-child">
							<dd class="active class-li-customerButtons" data-quanxian="37" data-myid="2">
								<a href="/infoNotice/noticeRelease.do" target="aa">首页公告管理</a>
							</dd> 
							<dd data-quanxian="38">
								<a href="/infoNotice/InformationNotice.do" target="aa">用户通知管理</a>
							</dd>
							<dd data-quanxian="39">
								<a href="/infoNotice/lbtglshow.do" target="aa">轮播发布管理</a>
							</dd>
						</dl>
						</li>
						<li class="layui-nav-item" data-quanxian="40"><a href="javascript:;">活动管理</a>
						<dl class="layui-nav-child">
							<dd class="active class-li-customerButtons" data-quanxian="41" data-myid="2">
								<a  href="/activity/preferentialActivityPage.do" target="aa">优惠活动管理</a>
							</dd> 
							<dd class="active class-li-customerButtons" data-quanxian="42" data-myid="2">
								<a  href="/activity/luckyPage.do" target="aa">幸运抽奖管理</a>
							</dd> 
						</dl>
						</li>
						<li class="layui-nav-item" data-quanxian="43"><a href="javascript:;">客服管理</a>
						<dl class="layui-nav-child">
							<dd class="active class-li-customerButtons" data-quanxian="44" data-myid="2">
								<a  href="/kf/onlineServicePage.do" target="aa">在线客服管理</a>
							</dd> 
							<dd class="active class-li-customerButtons" data-quanxian="45" data-myid="2">
								<a  href="/kf/qqCustomerServicePage.do" target="aa">QQ客服管理</a>
							</dd>	
							<dd class="active class-li-customerButtons" data-quanxian="46" data-myid="2">
								<a  href="/kf/kefu.do" target="_blank">客服聊天系统</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="47" data-myid="2">
								<a href="/kf/keFuAutomatic.do" target="aa">自动回复管理</a>
							</dd>
							<dd class="active class-li-customerButtons" data-quanxian="48" data-myid="2">
								<a href="/kf/kefuQuick.do" target="aa">快捷回复管理</a>
							</dd>
																					
						</dl>
						</li>
						<li class="layui-nav-item" data-quanxian="49"><a href="javascript:;">系统管理</a>
						<dl class="layui-nav-child">
							<dd class="active class-li-customerButtons" data-quanxian="50" data-myid="2">
								<a  href="/admin/systemManagementPage.do;" target="aa">平台基本管理</a>
							</dd> 
							<dd data-quanxian="51">
								<a href="/admin/onlinePaymentPage.do;" target="aa">在线入款管理</a>
							</dd>
							<dd data-quanxian="52">
								<a href="/admin/bankOfdepositPage.do;" target="aa">入款银行管理</a>
							</dd>	
							<dd data-quanxian="53">
								<a href="/admin/sweepCodePaymentPage.do;" target="aa">扫码支付管理</a>
							</dd>						
							<dd data-quanxian="54">
								<a href="/admin/promotionLinksPage.do;" target="aa">推广链接管理</a>
							</dd> 
							<dd data-quanxian="55">
								<a href="/admin/bindDomainNamePage.do;" target="aa">绑定域名管理</a>
							</dd>
							<dd data-quanxian="56">
								<a href="/admin/websiteAppPage.do" target="aa">下载页面管理</a>
							</dd>
							<dd data-quanxian="57">
								<a href="/explain/explainPage.do" target="aa">说明页面管理</a>
							</dd>
							<dd data-quanxian="58">
								<a href="/admin/updateSystemPage.do" target="aa">页面更新管理</a>
							</dd>
 							<dd data-quanxian="59">
								<a href="/admin/generalAgentRegisterPage.do" target="aa">总代理用户管理</a>
							</dd>
							<dd data-quanxian="65">
								<a href="/admin/whiteListPage.do;" target="aa">白名单用户管理</a>
							</dd>
						</dl>
						</li>
						<li class="layui-nav-item" data-quanxian="60"><a href="javascript:;">后台管理</a>
						<dl class="layui-nav-child">
							<dd class="active class-li-customerButtons" data-myid="2" data-quanxian="61">
								<a  href="/kajhsgweasdqtwehghasfdnsak6868/findAdminUser.do" target="aa">后台用户管理</a>
							</dd> 
							<dd  class="active class-li-customerButtons" data-quanxian="62" data-myid="2">
								<a href="/kajhsgweasdqtwehghasfdnsak6868/userJurisdictionPage.do" target="aa">用户权限管理</a>
							</dd>
							<dd data-quanxian="63">
								<a href="/kajhsgweasdqtwehghasfdnsak6868/findUserLoginLog.do" target="aa">登录日志管理</a>
							</dd>
							<dd data-quanxian="64">
								<a href="/kajhsgweasdqtwehghasfdnsak6868/findAdminUserOperationLog.do" target="aa">操作日志管理</a>
							</dd>
						</dl>
						</li>
				</ul>
			</div>
		</div>
		<div class="layui-body">
			  <iframe id="testFrame" name="aa" src="/welcomeSite.jsp" style="padding:10px; border:none;flex:1;"></iframe>  
		</div>
	</div>
	
	<!-- 模态框（Modal） -->
<div class="modal fade" id="lotterModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width:1000px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">未开奖</h4>
            </div>
            <div class="modal-body">
 			<table class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover"
				id="table_id_example2">
				<thead>
					<tr>
						<th style="display:none;"></th>
						<th class="class-th">期号</th>
						<th>彩种名称</th>
						<th class="class-th">开奖号码</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				</tbody>
			</table>              
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>	
	
<div class="modal fade" id="noticeModal" tabindex="-1" role="dialog" aria-labelledby="noticeModal" aria-hidden="true">
    <div class="modal-dialog class-fake-alert">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body" ></div>
            <div class="modal-footer">	      
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>   		


<div class="modal fade" id="updAndEditModal" tabindex="-1" role="dialog" aria-labelledby="updAndEditModal" aria-hidden="true">
	<div class="modal-dialog" style="width:700px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">新增/修改</h4>
			</div>
			<div class="modal-body">
			<input id="input-i-id" hidden="hidden" class="input-auto" />
			<form>
			<p style="font-size:14px;font-weight:bold;color:red;" class="p-i-noticeText">占位符</p>
			<div style="display: flex">
				<span style="margin-top: 32px;" >开奖号码：</span>
	             <p  class="p-c-flexwrapper" id="p-i-lotterNumWrapper">
	             	<input  maxlength='80' class='form-control input-c-lotterNumber' required />
	            </p> 
			</div>
             	
			</form>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary" id="button-i-addNewQQNumber2">提交更改</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="tuikuanModal" tabindex="-1" role="dialog" aria-labelledby="tuikuanModal" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">一键退款</h4>
            </div>
            <div class="modal-body">
            	<p style="display:flex;align-items:center;"><span style="width:80px;display:inline-block;">异常期号：</span><input required class="form-control input-c-qihaoValue" style="width:auto;flex-grow:1;" /></p>
            	<p style="display:flex;align-items:center;"><span style="width:80px;display:inline-block;">异常彩种：</span>
            		<select required style="width:auto;flex-grow:1;" class="form-control select-c-chooseCaiZhong">
            			<option value="bjpk10">北京PK拾</option>
            			<option value="2fpk10">二分PK拾</option>
            			<option value="xyft">幸运飞艇</option>
            			<option value="xysm">幸运赛马</option>
            			<option value="cqssc">重庆时时彩</option>
            			<option value="2fssc">二分时时彩</option>
            			<option value="tjssc">天津时时彩</option>
            			<option value="xjssc">新疆时时彩</option>
            			<option value="gdkl10f">广东快乐十分</option>
            			<option value="cqkl10f">重庆快乐十分</option>
            			<option value="ah11x5">安徽11选5</option>
            			<option value="gd11x5">广东11选5</option>
            			<option value="jx11x5">江西11选5</option>
            			<option value="sd11x5">山东11选5</option>
            			<option value="sh11x5">上海11选5</option>
            			<option value="xg6hc">香港六合彩</option>
            			<option value="shssl">上海时时乐</option>
            			<option value="pl3">排列三</option>
            			<option value="fc3d">福彩3D</option>
            			<option value="ahk3">安徽快3</option>
            			<option value="gxk3">广西快3</option>
            			<option value="jsk3">江苏快3</option>
            			<option value="bjk3">北京快3</option>
            			<option value="jlk3">吉林快3</option>
            			<option value="bj28">北京28</option>
            			<option value="xy28">幸运28</option>
            		</select>
            	</p>
            	<p style="display:flex;align-items:center;"><span style="width:80px;display:inline-block;">开奖类型：</span>
            		<select required style="width:auto;flex-grow:1;" class="form-control select-c-chooseKaiJiangLeiXing">
            			<option value="官方开奖异常">官方开奖异常</option>
            			<option value="平台开奖异常">平台开奖异常</option>
            		</select>
            	</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" id="button-i-tuikuanBtn">确认退款</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>







<div class="modal fade" id="allNextLevelModal" tabindex="-1" role="dialog" aria-labelledby="allNextLevelModal" aria-hidden="true" style="z-index:1050;">
    <div class="modal-dialog class-fake-alert" style="width:1000px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body" >
            <span style="font-weight:bold;color:red;display:inline-block;margin-bottom:10px;">注：此查询只能看到当前在线人员</span>
            		<table id="table-i-dailiList"  class="table table-striped table-bordered table-hover">
            			<thead>
            				<tr>
            					<th>用户名称</th>
            					<th>账号余额</th>
            					<th>登录时间</th>
            					<th>用户等级</th>
            					<th>操作</th>
            					<th>用户详情</th>
            				</tr>
            			</thead>
            			<tbody>
            			</tbody>
            		</table>
            </div>
            <div class="modal-footer">	      
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>  

	<div class="modal fade" id="allNextLevelModalTourist" tabindex="-1"
			role="dialog" aria-labelledby="allNextLevelModal" aria-hidden="true"
			style="z-index: 1050;">
			<div class="modal-dialog class-fake-alert" style="width: 1000px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">&times;</button>
					</div>
					<div class="modal-body">
						<span
							style="font-weight: bold; color: red; display: inline-block; margin-bottom: 10px;">注：此查询只能看到当前在线的游客人员</span>
						<table id="table-i-dailiListTourist"
							class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>ip</th>
									<th>创建时间</th>
									<th>最近访问时间</th>
									<th>次数</th>
									<th>访问页面</th>
								</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal -->
		</div>

<div class="modal fade" id="QzxxLevelModal" tabindex="-1" role="dialog" aria-labelledby="allNextLevelModal" aria-hidden="true" style="z-index:1500;width:30%;margin-left: 30%;">
    <div class="modal-dialog class-fake-alert" style="margin-top:200px;" >
        <div class="modal-content" style="width:300px;">
            <div class="modal-header">
           				 系统提示
            </div>
            <div class="modal-body" style="text-align: center" ></div>
            <div class="modal-footer" style="border-top: none">	      
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>  
	<script src="/layui/layui.js"></script>
	<script type="text/javascript" src="/js/zhengzeTools.js"></script>
	<script type="text/javascript" src="/js/caizhongyusheLotterHelper.js"></script>
	<script type="text/javascript">
	var CURRENT_QIHAO
	var rechargeTrueAndFalse = true
	var drawingTrueAndFalse = true
	var setIntervalchongzhi;
	var setIntervaltikuan;
	var once = true;
	$(".span-c-nolotterNotice").on("click", function(e) {
		$("#table_id_example2").DataTable().ajax.reload()
		$("#lotterModal").modal("show")
	})
	
	 $("#table-i-dailiList").DataTable({
		      "bLengthChange": true,      
		      "bAutoWidth": false,
		      "bSort": false,
		      "dom": `t<"tableToolBar" p<"lengthWrapper" l>i>`,
		      'aLengthMenu':[5, 10, 20],
		       //"order": [[ 9, "asc" ]],  
		       "searching": true,  
		       "language": {//语言设置  
		            "lengthMenu": "每页显示 _MENU_ 条记录",     
		            "zeroRecords": "没有检索到数据",     
		            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
		            "info": "没有数据",     
		            "oPaginate": {     
		                "sFirst": "首页",     
		                "sPrevious": "前一页",     
		                "sNext": "后一页",     
		                "sLast": "尾页"    
		          	},
		            "search":"搜索:",
		            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
		            "infoEmpty":      "没有找到匹配的信息",
		         }, 
		         "columns": [
		                     { "data": "name" ,"className":"name-td" },
		                     { "data": "balance" },
		                     { "data": "lastTime"},
		                     { "data": "vip","className":"vip"},
		                     { "data": null,"defaultContent": "<button class='btn btn-default btn-sort'>强制下线</button> "},
		                     { "data": null,"defaultContent": "<button class='btn btn-default btn-sort-yhxq'>用户详情</button> "},
		                     { "data": "id", "className": "td-c-id hidden-td"},
		                    
		                   ],	 
			      "ajax": {
		    	  	  "type": 'post',
		    	      "url":"/kajhsgweasdqtwehghasfdnsak6868/onlineUser.do",
		    	      
				       },
		       })
	
	
	//当点击online 展示用户详情
	$(".onlineUser").on("click",function(){
		$("#allNextLevelModal").modal("show")
	 $("#table-i-dailiList").DataTable().ajax.url("/kajhsgweasdqtwehghasfdnsak6868/onlineUser.do").load()
	})
	//首次进入页面统计用户在线人数
	$.ajax({
			url:"/kajhsgweasdqtwehghasfdnsak6868/onlineUser.do",
			type: "post",
			data: {},
			success: function(data) {
				$("#onlineUser").text(data.data.length)
			}
		})		
		//用户强制下线操作
		$("#table-i-dailiList").on("click",".btn-sort",function(){
 		$.ajax({
 			type:"post",
 			url:"/kajhsgweasdqtwehghasfdnsak6868/logoutOther.do",
 			data:{
 				 "name":$(this).parent().siblings(".name-td").text()
 			},
 			success:function(data){
 				$("#table-i-dailiList").DataTable().ajax.url("/kajhsgweasdqtwehghasfdnsak6868/onlineUser.do").load();
 			}
 		})
 	})
	//会员详情跳转
	$("#table-i-dailiList").on("click",".btn-sort-yhxq",function(e){
		window.open("/kajhsgweasdqtwehghasfdnsak6868/findByIdUserInfo.do?id="+$(this).parent().siblings(".td-c-id").text(), "_blank", "scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
	})
	
	/* 充值 */
	$(".chongzhi").on("click",function(e){
		var currentThis = window.parent.document.querySelector(".layui-this")
		$(this).closest("li").addClass("layui-nav-itemed")
		window.parent.document.querySelector("#testFrame").src = '/zhgl/userRechargePage.do'
	})
	
	/* 提款 */
	$(".tixian").on("click",function(){
		var currentThis = window.parent.document.querySelector(".layui-this")
		$(this).closest("li").addClass("layui-nav-itemed")
		window.parent.document.querySelector("#testFrame").src = '/zhgl/userDrawingPage.do'
	})
	
	var USER_QUANXIAN = "${user.cwgl}".split(",")
	 layui.use('element', function() {
		var element = layui.element;
	}); 
 	$("[data-quanxian]").each(function(index, element) {
		var dataValue = element.dataset.quanxian
		if (!USER_QUANXIAN.includes(dataValue) && !element.classList.contains("layui-nav-item")) {
			if(dataValue == 2){
				$(".chongzhi").remove()
			}
			if(dataValue == 3){
				$(".tixian").remove()
			}
			element.remove()
		}
	})
	$(".layui-nav-tree .layui-nav-item").each(function(index, element) {
		var childs = element.querySelectorAll("[data-quanxian]")
		if (childs.length == 0) {
			element.remove()
		}
	})
	var UNDEAL_AUDIO = $("#audio-i-undealNotice")[0]
	$("#i-id-autioSwitch").on("click", function(e) {
		$(e.currentTarget).toggleClass("icon-audio-mute")
		if ($(e.currentTarget).hasClass("icon-audio-mute")) {
			UNDEAL_AUDIO.volume = 0
		} else {
			UNDEAL_AUDIO.volume = 1
		}
	})
	
	$(UNDEAL_AUDIO).on("canplay", function(e) {
		e.target.play()
	})
 	var  setIntervalchongzhitrue = true;
 	function Recharge(data){//处理充值
 		$("#chongzhi").text(data)//充值数量
 		if(data > 0){
 			if(setIntervalchongzhitrue){
 				setIntervalchongzhitrue = false;
					UNDEAL_AUDIO.src = "/music/htmusic/rukuan.wav"//提交入款的声音
				setIntervalchongzhi = setInterval(function() {
					UNDEAL_AUDIO.src = "/music/htmusic/rukuan.wav"//提交入款的声音
			 	}, 10000)  
 			}
		}else{
			//清空页面的条数并停止定时器
			clearInterval(setIntervalchongzhi);
			setIntervalchongzhitrue = true;
		}
	}
 	var setIntervaltikuantrue = true;
	function CashWithdrawal(data){//提现操作
		$("#tixain").text(data)//提款数量
		if(data > 0){
			if(setIntervaltikuantrue){
				setIntervaltikuantrue = false;
				UNDEAL_AUDIO.src = "/music/htmusic/chukuan.wav"//提款的声音
				setIntervaltikuan = setInterval(function() {
					UNDEAL_AUDIO.src = "/music/htmusic/chukuan.wav"//提款的声音
			 	}, 10000) 
			}
		}else{
			//清空页面的条数并停止定时器
			clearInterval(setIntervaltikuan);
			setIntervaltikuantrue = true;
		}
	}
	
	$("#table_id_example2").DataTable({
			      // "bPaginate": true,
			      "bLengthChange": true,      
			      "bSort": false,
			      // "bInfo": true,
			      "bAutoWidth": false,
//			         "bServerSide":true,
			      'aLengthMenu':[5,10, 20],
			       "searching": true, 
			       "dom": "t<'tableinfo'i<'tableSearch'p>l>",
//			    "searching": true,l
			       "language": {//语言设置  
			            "lengthMenu": "每页显示 _MENU_ 条记录",     
			            "zeroRecords": "没有检索到数据",     
			            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
			            "info": "没有数据",     
			            "oPaginate": {     
			                "sFirst": "首页",     
			                "sPrevious": "前一页",     
			                "sNext": "后一页",     
			                "sLast": "尾页"    
			          	},
			            "search":"",
			            "searchPlaceholder": "请输入关键字",
			            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
			            "infoEmpty":      "没有找到匹配的信息",
			         },
	 		         "columns": [
	 		                     {"data": "cname", "className": "hidden-td cname-td"},
			                     { "data": "period", "className": "period-td" },
			                     { "data": "gameNameInChinese" },
			                     { "data": "lotterNum", "className": "lotterNum-td"  },
			                     {"data": null, "defaultContent": "<button class='btn btn-success btn-c-save butter-cname' style='margin-right:16px;'>设置开奖号码</button> <button class='btn btn-info btn-c-paijiang'>派奖</button><button class='btn btn-danger btn-c-tuikuan' style='margin-left:16px;'>退款</button>"},
			                 ],	 		         
				      "ajax": {
			    	  	  "type": 'post',
			    	      "url":"/czgl/findCheckDataIsNull.do", 
				    	  "dataSrc": function(json) {
				    		  if(json.data==""){
					      			$(".span-c-nolotterNotice").removeClass("active");
					      	  } 
				    		  var newData = []
					      		
				    		  for (var i = 0; i < json.data.length; i++) {
				    			  var caizhongCname = json.data[i].cname
				    			  if (caizhongCname === "2fpk10" || caizhongCname === "2fssc" || caizhongCname === "xysm") {
				    				  continue
				    			  }
				    			  var lotterNum
				    			  if (!json.data[i].lotternumber) {
				    				  lotterNum = ""
				    			  } else {
				    				  lotterNum = json.data[i].lotternumber
				    			  }
				    			  var newObj = {
				    				   "cname": json.data[i].cname,
				    				   "period": json.data[i].period,
				    				   "gameNameInChinese": json.data[i].gameNameInChinese,
				    				   "lotterNum": lotterNum,
				    			  }
				    			  newData.push(newObj)
				    		  }
				    		  return newData
				    	  }
				      },			         
			    })  
	 
			    
	 /* 点击派奖 */
	$("#table_id_example2").on("click", ".btn-c-paijiang", function(e) {
		var $tr = $(e.currentTarget).closest("tr")
		if ($tr.find(".lotterNum-td").text() == "") {
			showNoticeModal("未填写开奖号码，无法派奖")
			return
		}
		ajax({
			url: "/czgl/lotterCheckNum.do",
			type: "post",
			data: {
				"cName": $tr.find(".cname-td").text(),
				"period": $tr.find(".period-td").text(),
			},
			success: function(data) {
				var newData = JSON.parse(data)
				if (newData.data === 1) {
					showNoticeModal("派奖成功！")
					$("#table_id_example2").DataTable().ajax.reload()
				} else {
					showNoticeModal(newData.message)
				}
			},
			error: function(status) {
			}
		})	
	})	    
		/*确认提款 */
		$("#table_id_example2").on("click", ".btn-c-tuikuan", function(e) {
			var $tr = $(e.currentTarget).closest("tr")
			$("#tuikuanModal .input-c-qihaoValue").val($tr.find(".period-td").text())
			$("#tuikuanModal .select-c-chooseCaiZhong").val($tr.find(".cname-td").text())
			$("#tuikuanModal").modal("show")
		})	  	
			var obj2 = {
					btnName: "#button-i-tuikuanBtn",
					divName: "#tuikuanModal",
					isRegArray: [
		             {
		            	 regValue: /^[0-9]+$/,
		            	 inputValue: function() {
		            		 return $(".input-c-qihaoValue").val()
		            	 },
		            	 noticeText: "期号必须由纯数字组成",
		             }
	               ],					
			}
			
			checkFormMethod(obj2, function() {
				var newRequest = {
					type: "post",
					url: "/czgl/oneClickUserRefund.do",
					data: {
						period: $(".input-c-qihaoValue").val(),
						cname: $(".select-c-chooseCaiZhong").val(),
						lotternumber: $(".select-c-chooseKaiJiangLeiXing").val(),
					},
					success: function(data) {
						var newData = JSON.parse(data)
						$('#tuikuanModal').modal("hide")						
						showNoticeModal(newData.message)
						$("#table_id_example2").DataTable().ajax.reload()
					},
					error: function(status) {
					}
				}
				ajax(newRequest)
			})					
		
		var CNAME
		var ROLEOBJ 
	
		
		/* 设置开奖号码 */
		$("#table_id_example2").on("click", ".btn-c-save", function(e) {
			var $tr = $(e.currentTarget).closest("tr")
			var cname =  $tr.find(".cname-td").text()
			var lotterNumber=$tr.find(".lotterNum-td").text();
			if(lotterNumber.trim()!=""){
				lotterNumber=lotterNumber.substring(0,lotterNumber.length-1);
			}
			bindLotterType(cname);
			CURRENT_QIHAO = $tr.find(".period-td").text() 
			$("#updAndEditModal").attr("data-lotter", cname)
			CNAME = $("#updAndEditModal").attr("data-lotter")
			$(".input-c-lotterNumber").val(lotterNumber)
			$("#updAndEditModal").modal("show")
			lotterInputListener(".input-c-lotterNumber",".p-i-noticeText");
		})
			var obj = {
				btnName: "#button-i-addNewQQNumber2",
				divName: "#updAndEditModal",
				callback: function() {
					if ($("#updAndEditModal #p-i-lotterNumWrapper").hasClass("active")) {
						return "开奖号码存在错误，无法提交"
					}
					return "ok"
				}
			}
	
			checkFormMethod(obj, function() {
				var lotternumber
				if($("#updAndEditModal .p-i-noticeText").hasClass("active")){
					layer.msg("请填写正确信息");
					return;
				}
				var cname = $("#updAndEditModal").attr("data-lotter")
				lotternumber = mixLooterNumber("#p-i-lotterNumWrapper .input-c-lotterNumber")
				var lotterData=CAIZHONG_OBJ[lotterType];
				var num = lotternumber.split(",")
				for(var i = 0;i<num.length;i++){
					if(num[i] === ""){
						num.splice(i);
					}
				}
				if(num.length!=lotterData.weishu){
					layer.msg("请填写正确的开奖号码，开奖号码为"+lotterData.weishu+"位数");
					return
				}
				var newRequest = {
					url: "/czgl/updateCheckNum.do",
					type: "post",
					data: {
						lotterNumber: lotternumber,
						cName: cname,
						period: CURRENT_QIHAO,
					},
					success: function(data) {
						var newData = JSON.parse(data)
						showNoticeModal("操作成功！")
						$('#updAndEditModal').modal("hide")
						var table = $("#table_id_example2").DataTable()
						table.ajax.reload()
					},
					error: function(status) {
					}
				}
				ajax(newRequest)
			})	
			function AbnormalData(data){//异常数据样式加载
				 if (data == 1) {//data等于1有异常数据
					$(".span-c-nolotterNotice").addClass("active")
				} else {
					$(".span-c-nolotterNotice").removeClass("active")
				} 
			}
 	
	 	
		 /* 连接websocket的方法 */
		function reconnect(){
		   var url=window.location.href.replace("kajhsgweasdqtwehghasfdnsak6868/index.do","").replace("http","ws")  
		  	 rews = new WebSocket(url+"/websocketht/socketServerht.do");  
		 	/* 连接发生错误的回调方法   */
		 	 rews.onerror = function() {  
		 		//console.log("后台建立连接的时候发生异常错误！")
		 	};  
		       
		   /* 接收到消息的回调方法   */
		 	rews.onmessage = function(event) {
		 		var data=event.data
		 		var newData=JSON.parse(data)
		 		if(newData.type == 0){//有用户充值
		 			Recharge(newData.data);//把条数写到页面上面
		 		}
		 		if(newData.type == 1){//有用户提款
		 			CashWithdrawal(newData.data);
		 		}
		 		if(newData.type == 2){//在线人数
		 			$("#onlineUser").text(newData.data);
		 		}
		 		if(newData.type == 3){//某个会员登陆啦
		 			
		 		}
		 		if(newData.type == 4){//有会员注册并登陆成功
		 			
		 		}
		 		if(newData.type == 5){//5 - 开奖数据异常   传0 没有异常数据  传1 有异常数据
		 			AbnormalData(newData.data);
		 		}
		 		/* console.log($(".nav-tabs-fake"),"拿到的东西"); */
		 		if(newData.type == 6){
		 			if($(".layui-this a").text() == "私彩预设管理"){
		 				window.frames["aa"].bandxiazhu();
		 			}
		 		}
		 	};  
		 	/* 连接成功建立的回调方法 */
			 rews.onopen = function(event){
					//console.log("后台建立连接成功！");
			};
		       
		 	/* 连接关闭的回调方法   */
		 	rews.onclose = function(event) {
		 		//console.log("连接已关闭！")
		 	};  
		 	/* 监听窗口关闭事件，当窗口关闭时，主动去关闭websocket连接，防止连接还没断开就关闭窗口，server端会抛异常。   */
		 	window.onbeforeunload = function() { 
		 		rews.close();  
		 	}; 
		 	if(once){
		 		once = false;
				reconnects=setInterval(function(){
					/* 后台断开了就重连 */
					//console.log("我在调用reconnect()方法")
					if(rews.readyState != 1){
						reconnect();
					}
			  },30000)
		 	}
		 }
	reconnect();
	</script>
</body>
</html>